 <div id="editUser" class="view_client zoom-anim-dialog  view-booking-popup">
<form class="add_userM profile" id="edit"  method="POST" action="editUsersManage.php" enctype="multipart/form-data">
<script type="text/javascript" language="javascript">
	$(document).ready(function(){
		var pop=$(this).attr("href");
		var r=$("option:selected").val();
		if (r<=1)
		{
		$(".co").show();
		}
		else
		{
		$(".co").hide();		
		}
				$("select").change(function(){
		var r=$(this).has("option:selected").val();
		if (r<=1)
		{
		$(".co").show();
		}
		else
		{
		$(".co").hide();
		}
	});
		//empty on focus
		$('input#password').focus(function(){

			$(this).select();
		});
				//empty on focus
		$('input#password').focus(function(){

			$(this).select();
		});
	});

</script>
<div class="pop-ups-container">
                        <h1>تعديل المستخدم</h1>
                        <hr />
						
                        <table style="white-space:nowrap;" class="edit-client-table">
                            	<tr>
                                    <td style="width:200px;">الاسم الاول</td>
                                    <td>
									<input type="hidden" class="small-input" name="user_id" value="<?php echo $user['user_id']; ?>">
									<input type="text" class="small-input" name="first_name" value="<?php echo $user['first_name']; ?>">
									</td>
                                </tr>
                                <tr>
                                    <td>الاسم الاخير</td>
                                    <td><input type="text" class="small-input" name="last_name" value="<?php echo $user['last_name']; ?>"> </td>
                                </tr>
                                <tr>
                                    <td>اسم المستخدم</td>
                                    <td><input type="text" class="small-input" name="username" value="<?php echo $user['username']; ?>"></td>
                                </tr>
                                <tr>
                                    <td>البريد الاليكترونى</td>
                                    <td><input type="email" required class="small-input" name="email" value="<?php echo $user['email']; ?>"></td>
                                </tr>
                                <tr>
                                    <td>الجوال</td>
                                    <td><input type="text" class="small-input" name="phone" value="<?php echo $user['phone']; ?>"></td>
                                </tr>
								
								<tr>
                                    <td>نوع المستخدم</td>
                                    <td> <select name="type" class="small-input">
									<?php	
										$types= query('SELECT * FROM roles');
										foreach($types as $type){
										if (($type['id']==0||$type['id']==1)&&$_SESSION['r']>0)
										{
										continue;
										}
										elseif($user['role']<=1&&$type['id']>1)
										{
										continue;
										}
										
										if($user['name']==$type['name'])
										echo "<option selected='selected' value='{$type['id']}'>{$type['name']}</option>";
                                        else
                                         echo "<option  value='{$type['id']}'>{$type['name']}</option>";
										
										}					
		                                ?>
									</select></td>
                                </tr>
								
                                <tr>
                                    <td>كلمة المرور</td>
                                    <td><input class="small-input" type="password" name="password" id="password" value="<?php echo $user["password"]; ?>"></td>
                                </tr>
								 <tr>
                                    <td>تأكيد كلمة المرور</td>
                                    <td><input class="small-input" type="password" name="confirm_password" id="confirm_password" value="<?php echo $user["password"]; ?>">
									<input type="hidden" name="oldpass" value="<?php echo $user["password"]; ?>">
									</td>
                                </tr>
																								 <tr class="co">
                                    <td>اسم الفندق</td>
                                    <td><input class="small-input" type="text" name="hname" value="<?php echo $user['orgnanization_name']; ?>" required></td>
									
                                </tr>
																 <tr class="co">
                                    <td>تليفون الفندق</td>
                                    <td><input class="small-input" type="text" value="<?php echo $user['ophone']; ?>" name="htel"></td>
									
                                </tr>
																 <tr class="co">
                                    <td>رقم الفاكس</td>
                                    <td><input class="small-input" type="text" value="<?php echo $user['ofax']; ?>" name="hfax" ></td>
									
                                </tr>
																								 <tr class="co">
                                    <td>الموقع</td>
                                    <td><input class="small-input" type="text" name="hweb" value="<?php echo $user['oweb']; ?>"></td>
									
                                </tr>
																																 <tr class="co">
                                    <td>تغيير اللوجو</td>
                                    <td><input class="small-input" type="file" name="hlogo" dir="rtl"></td>
									
                                </tr>
                         </table>
                         <div class="edit-button">تعديل</div>
                         </div>
						 </form>
						 </div> 